package labox.innovation.gameserver.network.clientpackets;

import labox.innovation.gameserver.model.actor.instance.FuzePcInstance;

/**
 * 客户端通知服务器坐标
 * 
 * @version $Revision: 1.4.2.1.2.2 $ $Date: 2005/03/27 15:29:29 $
 */
public final class Location extends L2GameClientPacket {

	private static final String _C__62_LOCATION = "[C] 62 Location";

	private int _x, _y;

	private long _time;

	@Override
	protected void readImpl() {
		_x = readUnShort();
		_y = readUnShort();
		_time = System.currentTimeMillis();
	}

	@Override
	protected void runImpl() {
		FuzePcInstance activeChar = getClient().getActiveChar();
		if (activeChar == null)
			return;
		activeChar.getPosition().setXY(_x, _y, _time);
	}

	/* (non-Javadoc)
	 * @see labox.innovation.gameserver.clientpackets.ClientBasePacket#getType()
	 */
	@Override
	public String getType() {
		return _C__62_LOCATION;
	}
}
